import 'package:flutter/material.dart';
// import 'package:flutterdemo/actualcombat/actualcombat.dart';
// import 'package:flutterdemo/actualcombat/page/globalkeydemo.dart';
// import 'package:flutterdemo/actualcombat/page/rebuildtabbar.dart';
// import 'package:flutterdemo/actualcombat/page/zhihu.dart';
import 'package:flutterdemo/model/providermodel/userinfobasic.dart';
import 'package:flutterdemo/pages/dart/DartOperator.dart';
import 'package:flutterdemo/res/colors.dart';
import 'package:flutterdemo/res/config.dart';
import 'package:provider/provider.dart';

class Tab4 extends StatefulWidget {
  Tab4({Key key}) : super(key: key);

  _Tab4State createState() => _Tab4State();
}

class _Tab4State extends State<Tab4> with AutomaticKeepAliveClientMixin {
  @override
  Widget build(BuildContext context) {
    super.build(context);
    return Scaffold(
      appBar: AppBar(
        title: Text('dart语法 ${Provider.of<UserInfo>(context).counter}'),
      ),
      body: ListView(
        children: <Widget>[
          Text('dart语法 ${Provider.of<UserInfo>(context).counter}'),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              Text(
                Colours.app_main.toString(),
                style: TextStyle(
                  color: Colours.common_orange,
                ),
              ),
              Text(
                "${BaseConfig.BASEURL_H5}",
                style: TextStyle(
                  color: Colours.green_1,
                ),
              ),
            ],
          ),
          ListTile(
            title: Text('?. 及 ?? dart赋值表达式等'),
            onTap: () {
              Navigator.push(
                context,
                new MaterialPageRoute(
                  builder: (BuildContext context) => DartOperator(),
                ),
              );
            },
          ),
          // ListTile(
          //   title: Text('Flutter从入门到进阶 实战携程网App'),
          //   onTap: () {
          //     Navigator.push(
          //       context,
          //       new MaterialPageRoute(
          //         builder: (BuildContext context) => ActualCombat(),
          //       ),
          //     );
          //   },
          // ),
          // ListTile(
          //   title: Text('知乎总结'),
          //   onTap: () {
          //     Navigator.push(
          //       context,
          //       new MaterialPageRoute(
          //         builder: (BuildContext context) => ZhiHu(),
          //       ),
          //     );
          //   },
          // ),
          // ListTile(
          //   title: Text('MsgList'),
          //   onTap: () {
          //     Navigator.push(
          //       context,
          //       new MaterialPageRoute(
          //         builder: (BuildContext context) => MsgList(),
          //       ),
          //     );
          //   },
          // ),
          // ListTile(
          //   title: Text('GlobalKey'),
          //   onTap: () {
          //     Navigator.push(
          //       context,
          //       new MaterialPageRoute(
          //         builder: (BuildContext context) => GlobalKeyDemo(),
          //       ),
          //     );
          //   },
          // ),
        ],
      ),
    );
  }

  bool get wantKeepAlive => true;
}
